﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace ZeroBugBounce.Missive
{
	public interface IHandlerContext
	{
		object Message { get; }
		Topic Topic { get; }
		CancellationToken CancellationToken { get; }
		Boolean CanReply { get; }
	}

	public class HandlerContext<T> : IHandlerContext
	{
		public T Message { get; set; }
		public CancellationToken CancellationToken { get; protected internal set; }
		public Topic Topic { get; protected internal set; }
		public Boolean CanReply { get; protected internal set; }

		object IHandlerContext.Message
		{
			get
			{
				return (object)Message;
			}
		}
	}
}
